﻿@using Microsoft.Web.Helpers
@model SimpleScrum.Models.RegisterExternalLoginModel
@{
    ViewBag.Title = "External Login Confirmation";
    List<string> GenderList = new List<string>();
    GenderList.Add("Male");
    GenderList.Add("Female");
    GenderList.Add("Other");
    var showRecaptcha = true;
    if (IsPost) {
        if (ReCaptcha.Validate()) {
            @:Your response passed!
            showRecaptcha = false;}
        else{
            @:Your response didn't pass!
        }
    } 
}
<div class="row-fluid">
    <div class="span11 offset1">
        <hgroup class="title">
            <h3>@ViewBag.Title</h3>
            <h4 class="title message">Associate your @ViewBag.ProviderDisplayName account.</h4>
        </hgroup>
    </div>
</div>
<div class="row-fluid">
    <div class="span11 offset1">
        <section>
            <fieldset>
                <legend>Association Form</legend>
                @using (Html.BeginForm("ExternalLoginConfirmation", "Account", new { ReturnUrl = ViewBag.ReturnUrl })) {
                    @Html.AntiForgeryToken()
                    <div class="text-error">@Html.ValidationSummary(true)</div>
                    <div class="span10 offset1">
                        <p>You've successfully authenticated with <strong>@ViewBag.ProviderDisplayName</strong>.
                            Please enter a user name for this site below and click the Confirm button to finish
                            logging in.</p>
                    </div>
                    <div class="span5 offset2 thumbnail">
                        <div class="popover-title">
                            <div class="control-group">
                                <div class="control-label">@Html.LabelFor(m => m.Email)</div>
                                <div class="controls">@Html.TextBoxFor(m => m.Email)
                                    <div class="text-warning">@Html.ValidationMessageFor(m => m.Email)</div>
                                </div>
                            </div>
                            <div class="control-group">
                                <div class="control-label">@Html.LabelFor(m => m.Gender)</div>
                                <div class="controls">
                                    @Html.DropDownListFor(m => m.Gender, new MultiSelectList(GenderList))
                                    <div class="text-warning">@Html.ValidationMessageFor(m => m.Gender)</div>
                                </div>
                            </div>
                            <div class="control-group">
                                <div class="control-label">@Html.LabelFor(m => m.FirstName)</div>
                                <div class="controls">@Html.TextBoxFor(m => m.FirstName)
                                    <div class="text-warning">@Html.ValidationMessageFor(m => m.FirstName)</div>
                                </div>
                            </div>
                            <div class="control-group">
                                <div class="control-label">@Html.LabelFor(m => m.LastName)</div>
                                <div class="controls">@Html.TextBoxFor(m => m.LastName)
                                    <div class="text-warning">@Html.ValidationMessageFor(m => m.LastName)</div>
                                </div>
                            </div>
                            <div class="control-group">
                                <div class="control-label">@Html.LabelFor(m => m.Link)</div>
                                <div class="controls">@Html.TextBoxFor(m => m.Link)
                                    <div class="text-warning">@Html.ValidationMessageFor(m => m.Link)</div>
                                </div>
                            </div>
                            <div class="control-group">
                                @if (showRecaptcha == true)
                                {
                                    if (ReCaptcha.PrivateKey != "")
                                    {
                                        <div class="control-label">
                                            @ReCaptcha.GetHtml(theme: "green")
                                        </div>
                                        @Html.HiddenFor(m => m.ExternalLoginData)
                                        <br/>
                                        <div class="controls">
                                            <input class="btn btn-success" type="submit" value="Register" />
                                        </div>
                                    }
                                }
                            </div>
                        </div>
                    </div>
                }
            </fieldset>
        </section>
    </div>
</div>
@section Scripts {
    @Scripts.Render("~/bundles/jqueryval")
}
